home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_c / cuj0896.zip / WAMPLER.ZIP / DRAWAPP.CXX next >
C/C++ Source or Header  |  1996-05-24  |  2KB  |  62 lines

  1. //================================================================
  2. //  drawapp.cxx:     Source file for simple draw V application
  3. //  Copyright (C) 1995  Bruce E. Wampler
  4. //================================================================
  5. //  Files required for draw application:
  6. //      drawapp.h:      Header for the draw app
  7. //      drawapp.cxx:    Source code for draw app class
  8. //      drawcmdw.h:     Header for draw command window class
  9. //      drawcmdw.cxx:   Source code for draw command window
  10. //      drawcnv.h:      Header for draw canvas class
  11. //      drawcnv.cxx:    Source for draw canvas class
  12. //
  13. #include "drawapp.h"    // our header
  14.  
  15. //==================>>> drawApp::NewAppWin <<<====================
  16. vWindow* drawApp::NewAppWin(vWindow* win, char* name, int h, int w,
  17.   vAppWinInfo* winInfo)
  18. {
  19.   // Create a new Draw window
  20.  
  21.   vWindow* thisWin = win;             // local copy to use
  22.   vAppWinInfo* awinfo = winInfo;
  23.  
  24.   if (!thisWin)                       // need to new a window
  25.     {
  26.       thisWin = new myCmdWindow(name, h, w);
  27.     }
  28.   if (!awinfo)
  29.       awinfo = new vAppWinInfo(name);
  30.  
  31.   return vApp::NewAppWin(thisWin, name, h, w, awinfo);
  32. }
  33.  
  34. //======================>>> drawApp::Exit <<<=====================
  35. void drawApp::Exit(void)
  36. {
  37.   // This is called to close all windows. 
  38.   vApp::Exit();          // easy default behavior
  39. }
  40.  
  41. //====================>>> drawApp::CloseAppWin <<<================
  42. void drawApp::CloseAppWin(vWindow* win)
  43. {
  44.   // Code to handle close of window (such as saving/closing
  45.   // a file) would go here...
  46.  
  47.   vApp::CloseAppWin(win);
  48. }
  49.  
  50. //***** EVERY V application needs to declare an app instance *****
  51.  
  52. static drawApp draw_App("V Draw");    // The instance of the app
  53.  
  54. //========================>>> AppMain <<<=========================
  55. int AppMain(int argc, char** argv)
  56. {
  57.   // Use AppMain to create the main window
  58.  
  59.   theApp->NewAppWin(0, "V Draw - No Name", 250, 500,0);
  60.   return 0;                 // 0 means OK
  61. }
  62.